package com.aspose.cells;

import java.util.ArrayList;

public class MsoFormatPicture {
   private zash c;
   zke a = null;
   ArrayList b = null;

   MsoFormatPicture(Shape shape) {
      this.c = shape.N().c();
   }

   public double getTopCrop() {
      return (double)this.c.a(256, 0.0F);
   }

   public void setTopCrop(double value) {
      this.c.b(256, (float)value);
   }

   public double getBottomCrop() {
      return (double)this.c.a(257, 0.0F);
   }

   public void setBottomCrop(double value) {
      this.c.b(257, (float)value);
   }

   public double getLeftCrop() {
      return (double)this.c.a(258, 0.0F);
   }

   public void setLeftCrop(double value) {
      this.c.b(258, (float)value);
   }

   public double getRightCrop() {
      return (double)this.c.a(259, 0.0F);
   }

   public void setRightCrop(double value) {
      this.c.b(259, (float)value);
   }

   public CellsColor getTransparentColor() {
      if (this.a == null) {
         return null;
      } else if (this.a.a != null && this.a.b != null && this.a.a.b() == this.a.b.b() && this.a.a.d() == this.a.b.d() && !this.a.a.b(2) && this.a.b.h() == 0) {
         CellsColor var1 = this.c.g().n().createCellsColor();
         var1.a = this.a.a;
         return var1;
      } else {
         return null;
      }
   }

   public void setTransparentColor(CellsColor value) {
      if (value != null && !value.a.a()) {
         this.a = new zke();
         this.a.a = value.a;
         this.a.b = value.a;
         this.a.b.a(0);
         this.c.a(263, 1, value.getColor());
      } else {
         this.a = null;
      }

   }

   public double getContrast() {
      double var1 = (double)this.c.c(264, 65536);
      if (var1 == 0.0D) {
         var1 = 0.0D;
      }

      if (var1 >= 65536.0D) {
         var1 = 100.0D - 100.0D / (var1 / 32768.0D);
      } else {
         var1 = 100.0D * (var1 / 131072.0D);
      }

      return var1 * 2.0D - 100.0D;
   }

   public void setContrast(double value) {
      double var3 = (value + 100.0D) / 2.0D;
      if (var3 >= 50.0D) {
         var3 = 3276800.0D / (100.0D - var3);
      } else {
         var3 = 131072.0D * var3 / 100.0D;
      }

      this.c.a(264, 0, (int)var3);
   }

   public double getBrightness() {
      double var1 = (double)this.c.c(265, 0);
      return var1 / 32768.0D * 100.0D;
   }

   public void setBrightness(double value) {
      double var3 = value * 32768.0D / 100.0D;
      this.c.a(265, 0, (int)var3);
   }

   public boolean isBiLevel() {
      return this.c.a(319, 1, false);
   }

   public void setBiLevel(boolean value) {
      this.c.b(319, 1, value);
   }

   public boolean isGray() {
      return this.c.a(319, 2, false);
   }

   public void setGray(boolean value) {
      this.c.b(319, 2, value);
   }
}
